/**
 * 
 */
package idv.takeshi.software.productline.bookstore.application.service;

import idv.takeshi.software.productline.bookstore.domain.model.category.BookAlreadyAttachedException;
import idv.takeshi.software.productline.bookstore.domain.model.category.Category;
import idv.takeshi.software.productline.bookstore.domain.model.category.CategoryException;
import idv.takeshi.software.productline.bookstore.domain.model.category.CategoryNameNotSetException;
import idv.takeshi.software.productline.bookstore.domain.model.valueobject.InternationalText;

/**
 * A service interface for maintaining Category models operations.
 * @author takeshi
 *
 */
public interface MaintainCategoriesService {
	
	
	/**
	 * Get Root category.
	 * @return
	 */
	public Category getRootCategory();
	
	/**
	 * Add a new category
	 * @param parentCategory
	 * @param iText
	 * @return a new category ID.
	 * @throws CategoryException 
	 */
	public Long addNewCategory(Long parentCategoryId, InternationalText iText) 
		throws CategoryException;
	
	/**
	 * Update a category.
	 * @param categoryId
	 * @param newIText
	 */
	public void updateCategory(Long categoryId, InternationalText newIText);
	
	/**
	 * Remove a category.
	 * @param categoryId
	 * @throws CanNotRemoveCategoryException
	 */
	public void removeCategory(Long categoryId) throws CanNotRemoveCategoryException;
	
	/**
	 * Move a category to a new position.
	 * @param parentCategoryId
	 * @param categoryId
	 * @param newSequence
	 * @throws BookAlreadyAttachedException 
	 */
	public void moveCategory(Long parentCategoryId, Long categoryId, int newSequence) 
		throws BookAlreadyAttachedException;
}
